using Ardalis.Specification;

namespace Domain.Todos.Specifications;

/// <summary>
/// 按优先级查询待办事项规约
/// </summary>
public sealed class TodosByPrioritySpecification : Specification<TodoItem>
{
    public TodosByPrioritySpecification(Guid userId, Priority priority)
    {
        Query.Where(todo => todo.UserId == userId && todo.Priority == priority)
             .OrderByDescending(todo => todo.CreatedAt);
    }
}